{
    //简洁表达
    let o = 1
    let k = 2
    let es5 = {
        o: o,
        k: k
    }

    let es6 = {
        o, k
    }

    console.log(es5)
    console.log(es6);


    let es5_method = {
        hello: function () {
            console.log('huangliusong')
        }
    }

    //省略function () 
    let es6_method = {
        hello() {
            console.log('hello')
        }
    }

    //函数
    console.log(es5_method.hello());
    console.log(es6_method.hello());

}


{
    //属性表达式
    let a = 'b'
    let es5_obj = {
        a: 'c',
        b: 'c'
    }
    let es6_obj = {
        [a]: 'c'
    }
    console.log(es5_obj, es6_obj)
}

{
    //新增的api
    console.log('字符串', Object.is('abc', 'abc'), 'abc' == 'abc');
    console.log('数组', Object.is([], []), [] === [])

    console.log('拷贝', Object.assign({ a: 'a' }, { b: 'b' }));

    //对象转成数组
    console.log('对象转成数组-----start');
    let test = { k: 123, 0: 456 }
    for (let [key, value] of Object.entries(test)) {
        console.log([key, value])
    }
    console.log('对象转成数组-----end');
}


// {
//     //扩展运算符
//     let { a, b, ...c } = { a: 'test', b: 'kill', c: 'ddd', d: 'ccc' }
//     c = {
//         c: 'ddd',
//         d: 'ccc'
//     }

// }